package com.example.personnel_oa.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.comment_oa.pojos.Talentpool;
import com.example.comment_oa.pojos_vo.Talentpool_vo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;


/**
* @author asus
* @description 针对表【talentpool】的数据库操作Mapper
* @createDate 2022-10-13 11:23:21
* @Entity personnel_oa.pojos.Talentpool
*/
@Mapper
public interface TalentpoolMapper extends BaseMapper<Talentpool> {
    //删除人才
    @Update("update talentpool set talents_state = 1 where talents_id=#{talentsId}")
    int deleteTalentpool(int id);
    //修改人才个人信息
    // int updateT(Talentpool talentpool);
   //  根据输入框中的内容进行条件查询
    List<Talentpool> selectTalentpool(Talentpool talentpool);
    //我的关注页面根据输入框中的内容进行条件查询
    List<Talentpool> selectguanzhu(Talentpool_vo talentpoolVo);
    //简历模块查询全部
//    @Select("select * from talentpool  ORDER BY talents_time desc")
    List<Talentpool> selectjianli();
    //新增人才
    int Insert(Talentpool talentpool);
    //新增简历
    int insertResume(Talentpool talentpool);
    //添加到人才库
    @Update("update talentpool set talents_talenttag = #{talentsTalenttag}, talents_state = 2 where talents_id=#{id}")
    int update(String talentsTalenttag, int id);
    //添加到人才库
    @Update("update talentpool set talents_state = 2 where talents_id=#{id}")
    int update2(int id);
    //简历高级查询
    List<Talentpool> selectResume(Talentpool_vo talentpoolVo);
    //查询简历详情页面
    Talentpool resumeId(int talentsId);
    //查询所有人才
    List<Talentpool> Talentpool();
    //查询我的关注
    List<Talentpool> wodeguanzhu(int empId);
    //添加关注
    int insertguanzhu(int talentsId ,int empId);
    //取消关注
    int delguanzhu(int talentsId ,int empId);
    //根据人才id和关注人查询有没有这条数据
    Talentpool jiaoyangz(int talentsId ,int empId);
    //删除简历
    @Delete(" delete from talentpool where talents_id=#{talentsId}")
    int deleteTalentpools(int id);
    //新增关注
    int Insertguanzhu(Talentpool talentpool);
    @Select("SELECT * from talentpool WHERE talents_anniu = 1")
    Talentpool aa();
    @Update("update talentpool set talents_anniu = 0 where talents_id=#{talentsId}")
    int bb(int talentsId);
    //根据id查询人才
    Talentpool offerTalentpool(int talentsId);

}
